package com.nj.dms.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.nj.dms.dao.EssayDao;
import com.nj.dms.dao.impl.EssayDaoImpl;

/**
 * 删除多个文章
 */
@WebServlet("/DeleteAllEssay")
public class DeleteAllEssay extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// 1)接受客户端表单的批量选择的记录ID号
		String[] ids = request.getParameterValues("delID");

		EssayDao essayDao = new EssayDaoImpl();
		essayDao.deleteEssay(ids);

		response.sendRedirect("MyEssayList");

	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
